function el = getEllipse(a, b, x0, y0, theta)
% GETELLIPSE returns an ellipse EL specified by the semi-major-axis length A,
%   the semi-minor-axis length B, the centroid coordinates X0,Y0 and the 
%   orientation angle THETA.
% 
% Project:  Foreground detection [Bildfolgen LU]@CVL/TUWIEN
% Author:   Gruppe 10
% Date:     03/2011

t = linspace(0,2*pi, 500);
x = a*cos(t);
y = b*sin(t);
R = [cos(theta) sin(theta); -sin(theta) cos(theta)];    % rotation matrix
el = [x' y']*R;
% translation;
el(:,1) = el(:,1)+x0;
el(:,2) = el(:,2)+y0;
end